package com.ruoyi.retirement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.retirement.mapper.RetirementMenuMapper;
import com.ruoyi.retirement.domain.RetirementMenu;
import com.ruoyi.retirement.service.IRetirementMenuService;

/**
 * 首页菜单/一级分类Service业务层处理
 * 
 * @author 曹旭
 * @date 2025-09-01
 */
@Service
public class RetirementMenuServiceImpl implements IRetirementMenuService 
{
    @Autowired
    private RetirementMenuMapper retirementMenuMapper;

    /**
     * 查询首页菜单/一级分类
     * 
     * @param id 首页菜单/一级分类主键
     * @return 首页菜单/一级分类
     */
    @Override
    public RetirementMenu selectRetirementMenuById(Long id)
    {
        return retirementMenuMapper.selectRetirementMenuById(id);
    }

    /**
     * 查询首页菜单/一级分类列表
     * 
     * @param retirementMenu 首页菜单/一级分类
     * @return 首页菜单/一级分类
     */
    @Override
    public List<RetirementMenu> selectRetirementMenuList(RetirementMenu retirementMenu)
    {

        return retirementMenuMapper.selectRetirementMenuList(retirementMenu);
    }

    /**
     * 新增首页菜单/一级分类
     * 
     * @param retirementMenu 首页菜单/一级分类
     * @return 结果
     */
    @Override
    public int insertRetirementMenu(RetirementMenu retirementMenu)
    {
        retirementMenu.setCreateTime(DateUtils.getNowDate());
        return retirementMenuMapper.insertRetirementMenu(retirementMenu);
    }

    /**
     * 修改首页菜单/一级分类
     * 
     * @param retirementMenu 首页菜单/一级分类
     * @return 结果
     */
    @Override
    public int updateRetirementMenu(RetirementMenu retirementMenu)
    {
        retirementMenu.setUpdateTime(DateUtils.getNowDate());
        return retirementMenuMapper.updateRetirementMenu(retirementMenu);
    }

    /**
     * 批量删除首页菜单/一级分类
     * 
     * @param ids 需要删除的首页菜单/一级分类主键
     * @return 结果
     */
    @Override
    public int deleteRetirementMenuByIds(Long[] ids)
    {
        return retirementMenuMapper.deleteRetirementMenuByIds(ids);
    }

    /**
     * 删除首页菜单/一级分类信息
     * 
     * @param id 首页菜单/一级分类主键
     * @return 结果
     */
    @Override
    public int deleteRetirementMenuById(Long id)
    {
        return retirementMenuMapper.deleteRetirementMenuById(id);
    }
}
